package com.saicmotor.springboot_demo.model.json_pojo;

import org.springframework.stereotype.Repository;

import java.util.HashMap;

@Repository
public class JsonResult extends HashMap<String,Object> {
    public JsonResult msg(String msg){
        put("msg", msg);
        remove("data");
        return this;
    }

    public JsonResult data(Object data){
        put("data", data);
        remove("msg");
        return this;
    }

    public JsonResult all(String msg,Object data){
        put("msg", msg);
        put("data", data);
        return this;
    }
}
